#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Time   :2020/8/7 10:25
# Author : fenzhilaoling
from flask import Flask
from flask import redirect
from flask import url_for

app = Flask('my_app')


@app.route('/')
def index():
    return '这是首页'


@app.route('/info')
@app.route('/index')
def info():
    return '这是一条信息'


@app.route('/set_user/<user_name>')
def set_user(user_name):
    return f'用户名：{user_name}'


@app.route('/get_count/<int:count>')
def get_count(count):
    return f'传递的个数：{count}'


@app.route('/login')
def login():
    return '来到登陆页面'


@app.route('/home', redirect_to='/login')
def home():
    return 'home页面'


@app.route('/end_info')
def end_info():
    return redirect(url_for('login'))


if __name__ == '__main__':
    app.run(port='80', debug=True)
